package com.zx.base.util;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.util.DisplayMetrics;
import android.util.Log;

public class DPIExchange {
	int widthMax = 1920;
	int heightMax = 1080;
	DisplayMetrics metrics;
	public DPIExchange(Activity context){
		metrics = new DisplayMetrics();
		context.getWindowManager().getDefaultDisplay().getMetrics(metrics);
	}
	public int heightChange(int x)

	{
		int height = metrics.heightPixels;
		return x * height / heightMax;

	}

	public int widthChange(int x)

	{

		int height = metrics.widthPixels;
		return x * height / widthMax;

	}

}
